package com.qfedu.og.controller;

import com.qfedu.og.dto.GroupDto;
import com.qfedu.og.entity.Company;
import com.qfedu.og.entity.Group;
import com.qfedu.og.service.intf.CompanyService;
import com.qfedu.og.service.intf.GroupService;
import com.qfedu.og.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: OnlyGroup
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-03-25 14:56
 */
@Controller
@RequestMapping("/group/")
public class GroupController {
    @Autowired
    private GroupService service;

    @RequestMapping("save.do")
    @ResponseBody
    public R save(Group group){
        return service.save(group);
    }
    @RequestMapping("all.do")
    @ResponseBody
    public R all(){
        return service.all();
    }

    @RequestMapping(value = "create.do",method = RequestMethod.POST)
    @ResponseBody
    public R create(GroupDto dto){
        return service.randomGroup(dto);
    }
}
